package com.net2s.autenticacion;
import org.apache.log4j.Logger;
import org.jfree.util.Log;


import es.yell.wsdl.Sayc.YellAuthenticationSrv.*;
import es.yell.schema.Global.WSException.*;
 
// comentario  de prueba de svn
public class Autentica {
	static Logger log= Logger.getLogger(Autentica.class);
	
	public static boolean Autenticar (String user, String password){
		YellAuthenticationProxy proxy = new YellAuthenticationProxy();
		String remoteAddr="";
		YellAuthenticateRequest parameters = new YellAuthenticateRequest(user, password,remoteAddr);
	    boolean result=false;
		try{
			proxy.setEndpoint("http://sayc.yelldes.intrayell.com:8180/sayc-ws/yellAuthentication");
			
			YellAuthenticateResponse respuesta= proxy.yellAuthenticate(parameters);
			result=respuesta.isSuccess();
		}catch(Exception e){
			log.error(e.getMessage());
		}
		log.info("user:" + user + " password:" + password + " Autenticado:" + result);
		return result;
	}
	
	public static void main(String[] args){
		Autenticar("phe6591","gonzalo140681");
		
	}
}
